package com.espirit.eap.manager;

import javax.persistence.Entity;
import javax.persistence.Transient;

import com.espirit.eap.ICheckModelDuplicateInfo;
import com.espirit.eap.annotation.ModelDisplayProperty;

@Entity
@ModelDisplayProperty(value="text")
public class NbrRuleSource extends ItemFiling implements ICheckModelDuplicateInfo {

	public NbrRuleSource(){
		
	}
	
	public NbrRuleSource(int itemNbr, String code, String enName,String cnName) {
		super(itemNbr,code,enName,cnName);	
	}
	private static final long serialVersionUID = -2941467406386240493L;

	public static final String PREFIX = "prefix";
	public static final String YEAR = "year";
	public static final String MONTH = "month";
	public static final String DAY = "day";
	public static final String USERID = "userid";
	
	@Transient
	public boolean isPrefix(){
		return PREFIX.equals(getCode());
	}
	
	@Transient
	public boolean isYear(){
		return YEAR.equals(getCode());
	}

	@Transient
	public boolean isMonth(){
		return MONTH.equals(getCode());
	}

	@Transient
	public boolean isDay(){
		return DAY.equals(getCode());
	}
	
	@Transient
	public boolean isUserId(){
		return USERID.equals(getCode());
	}
	
	@Override
	public String[] gatherProperties() {
		return new String[]{"code"};
	}

}
